package com.whw.fy.controller;

import com.whw.fy.entity.Message;
import com.whw.fy.entity.TechnicalType;
import com.whw.fy.service.TeachSummaryService;
import com.whw.fy.service.TechnicalTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags = "技术类别模块")
@RestController
@RequestMapping("/api/technicalType")
public class TechnicalTypeController {
    @Resource
    private TechnicalTypeService technicalTypeService;

    @ApiOperation(value = "增加技术类别")
    @PostMapping("/")
    public Message insert(TechnicalType technicalType){
        return technicalTypeService.insertSelective(technicalType);
    }

    @ApiOperation(value = "查询所有技术类别")
    @GetMapping("/all")
    public Message selectAll(){
        return technicalTypeService.selectAll();
    }

    @ApiOperation(value = "根据id查询技术类别")
    @GetMapping("/id")
    public Message selectById(int id){
        return technicalTypeService.selectByPrimaryKey(id);
    }

    @ApiOperation(value = "根据id删除技术类别")
    @DeleteMapping("/id")
    public Message deleteById(int id){
        return technicalTypeService.deleteByPrimaryKey(id);
    }

    @ApiOperation(value = "根据id修改技术类别")
    @PutMapping("/")
    public Message update(TechnicalType technicalType){
        return technicalTypeService.updateByPrimaryKeySelective(technicalType);
    }
}
